<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css">
</head>
<style>
    .timeLine {
        width: 100%;
        display: -webkit-flex;
        display: flex;
        flex-direction: row;
    }

    .timeLineImg {
        width: 20%;
        display: -webkit-flex;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .timeLineLeft {
        height: 100%;
        width: 2px;
        border-left: 1px solid #B0B0B0;
    }

    .timeLineInfo {
        width: 80%;
    }

    .timeLineInfoTitle {
        font-size: 20px;
        color: #3f51b5;
    }

    .timeLineInfoIntroduce {
        font-size: 16px;
        color: #0062cc;
    }

    .timeLineInfoTime {
        font-size: 12px;
        color: #CA92C4;
    }

    .scoll {
        overflow: auto;
        margin-top: 65px;
    }
</style>

<body>
  <header class="aui-bar aui-bar-nav" style="position:fixed;" id="header">
      <a class="aui-pull-left aui-btn" tapmode onclick="closeWin();">
          <span class="aui-iconfont aui-icon-left"></span>
      </a>
      <div class="aui-title" id="title">
          保修单详情
      </div>
  </header>
    <div class="aui-tab aui-border-b" id="tab" style="margin-top:50px;">
        <!-- <div class="aui-tab-item aui-active">处理进度</div> -->
        <div class="aui-tab-item aui-active">设备故障</div>
    </div>
    <div class="aui-padded-5 " id="tab1-con">
        <!-- <div id="tab1-con1">
            <div class="list">

                <div class="timeLine">
                    <div class="timeLineImg" style="filter: drop-shadow(705px 0 0 #212121);">
                        <img src="../image/point.png">
                        <div class="timeLineLeft"></div>
                    </div>
                    <div class="timeLineInfo">
                        <div class="timeLineInfoTitle">管理员</div>
                        <div class="timeLineInfoIntroduce">故障提报，待派工</div>
                        <div class="timeLineInfoTime">2018-11-18/周日 21:33:34</div>
                    </div>
                </div>
                <div class="timeLine">
                    <div class="timeLineImg">
                        <img src="../image/clock.png">
                        <div class="timeLineLeft"></div>
                    </div>
                    <div class="timeLineInfo">
                        <div class="timeLineInfoTitle">状态:已申请</div>
                        <div class="timeLineInfoIntroduce">在广东广州分拨中心进行装车扫描，发往：四川成都分拨中心</div>
                        <div class="timeLineInfoTime">2018-11-18/周日 21:33:34</div>
                    </div>
                </div>
            </div>
        </div> -->
        <div  id="tab1-con2"><!-- class="aui-hide" -->
            <div class="aui-card-list ui-selectee">
                <div class="aui-card-list-content sortable ui-selectee ui-sortable">
                    <ul class="aui-list aui-form-list">
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">设备编码</div>
                                <div class="aui-list-item-input">
                                    <input type="text"  readonly id="equipCode" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">故障等级</div>
                                <div class="aui-list-item-input">
                                    <input type="text"  readonly id="faultLevel" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">故障类别</div>
                                <div class="aui-list-item-input">
                                    <input type="text"  readonly id="faultClass" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label ui-selectee">故障描述</div>
                                <div class="aui-list-item-input ui-selectee">
                                    <input type="text"  readonly id="description" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label" style="width: 45%;">故障提报时间</div>
                                <div class="aui-list-item-input">
                                    <input type="text"  readonly id="faultdate" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label">班组</div>
                                <div class="aui-list-item-input">
                                    <input type="text"  readonly id="teamGid" value="" />
                                </div>
                            </div>
                        </li>

                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label" style="width: 45%;">再发防止对策</div>
                                <div class="aui-list-item-input">
                                    <input type="text"  readonly id="recurrencePrevention" value="" />
                                </div>
                            </div>
                        </li>
                        <li class="aui-list-item">
                            <div class="aui-list-item-inner">
                                <div class="aui-list-item-label" style="width: 45%;">备注</div>
                                <div class="aui-list-item-input">
                                    <input type="text" readonly  id="remark" value="" />
                                </div>
                            </div>
                        </li>

                    </ul>
                </div>
            </div>
        </div>
    </div>

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/aui-tab.js"></script>
<script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
<script>
//返回按钮
function closeWin() {
    api.closeWin({});
}
    apiready = function() {
        api.parseTapmode();
        getEmequipmentfaultDataInfo(api.pageParam.sysid); //获取设备故障tab页信息
    }

    var tab = new auiTab({
        element: document.getElementById("tab"),

    }, function(ret) {
        if (ret) {
            //定义获取对象的所有兄弟节点的函数，
            function siblings(elm) {
                var a = [];
                var p = elm.parentNode.children;
                for (var i = 0; i < p.length; i++) {
                    if (p[i] !== elm) a.push(p[i]);
                }
                return a;
            }
            var index = ret.index;
            var activeC = document.getElementById("tab1-con" + index);
            activeC.className = "";
            for (var i = 0; i < siblings(activeC).length; i++) {
                siblings(activeC)[i].className = "aui-hide";
            }
        }
    });

    //获取信息
    function getEmequipmentfaultDataInfo(sysid) {
        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/getEmequipmentfaultDataInfo";
        var data = {
            values: {
                sysid: sysid,
                un: un
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function(ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");
                //返回成功
                if (myobj.code == "0") {
                    var entity = eval(myobj.entity);
                    $("#equipCode").val(entity.equipCode);
                    $("#faultLevel").val(entity.faultLevel);
                    $("#faultClass").val(entity.faultClass);
                    $("#description").val(entity.description);
                    $("#faultdate").val(entity.faultdate);
                    $("#teamGid").val(entity.teamGid);
                    $("#recurrencePrevention").val(entity.recurrencePrevention);
                    $("#remark").val(entity.remark);

                    //失败
                } else if (myobj.code == "1") {
                    //清空表格数据
                    $api.html($api.byId("tbodyHtml"), "");
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });
    }
</script>

</html>
